Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow declaring existential types inside blocks #52645

Merged
merged 1 commit into from
Jul 25, 2018

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jul 23, 2018

fixes #52631

r? @dtolnay

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 23, 2018
@rust-highfive

This comment has been minimized.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for the quick fix.

@dtolnay
Copy link
Member

dtolnay commented Jul 23, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Jul 23, 2018

📌 Commit 58758c5de691ff528a4053b84ef7b89f4b71724c has been approved by dtolnay

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 23, 2018
@@ -4391,6 +4391,10 @@ impl<'a> Parser<'a> {
self.token.is_keyword(keywords::Extern) && self.look_ahead(1, |t| t != &token::ModSep)
}

fn is_existential_type_decl(&self) -> bool {
self.token.is_keyword(keywords::Existential) && self.look_ahead(1, |t| t.is_ident())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why check if the next token is an ident rather than checking if it is the keyword type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because I got confused and panicked by beating the problem with a shovel?

For real: I didn't find a token::Type and decided "oh checking for the concrete identifier is too hard"... all while i did that before the &&...

I'll fix it asap

@oli-obk oli-obk force-pushed the existential_in_fn_body branch from 58758c5 to 2e33a55 Compare July 24, 2018 08:08
@oli-obk
Copy link
Contributor Author

oli-obk commented Jul 24, 2018

@bors r=dtolnay rollup

@bors
Copy link
Contributor

bors commented Jul 24, 2018

📌 Commit 2e33a55 has been approved by dtolnay

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 24, 2018
…tolnay

Allow declaring existential types inside blocks

fixes rust-lang#52631

r? @dtolnay
bors added a commit that referenced this pull request Jul 25, 2018
Rollup of 7 pull requests

Successful merges:

 - #52391 (Add unaligned volatile intrinsics)
 - #52402 (impl PartialEq+Eq for BuildHasherDefault)
 - #52645 (Allow declaring existential types inside blocks)
 - #52656 (Stablize Redox Unix Sockets)
 - #52658 (Prefer `Option::map`/etc over `match` wherever it improves clarity)
 - #52668 (clarify pointer offset function safety concerns)
 - #52677 (Release notes: add some missing 1.28 libs stabilization)

Failed merges:

r? @ghost
@bors bors merged commit 2e33a55 into rust-lang:master Jul 25, 2018
@oli-obk oli-obk deleted the existential_in_fn_body branch June 15, 2020 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fails to parse existential type in statement position
5 participants